package guowenlong.golf.ui.splash;

import android.content.Intent;
import android.os.Bundle;
import android.view.animation.AlphaAnimation;
import android.view.animation.Animation;
import android.widget.ImageView;
import butterknife.BindView;
import guowenlong.golf.R;
import guowenlong.golf.ui.home.HomeActivity;
import me.wenlong.mixutils.mvp.BaseActivity;
import me.wenlong.mixutils.util.LogUtils;

/**
 * des   : 描述 author: Administrator email : guowenlong20000@gmail.com time  : 2017年02月26日 上午 12:59.
 */

public class SplashActivity extends BaseActivity<SplashPresenter, SplashModel> implements
    SplashContract.View {

  @BindView(R.id.bg_start)
  ImageView bgStart;

  @Override
  protected int getContentView(Bundle savedInstanceState) {
    return R.layout.activity_splash;
  }

  @Override
  protected void initView(Bundle savedInstanceState) {

  }

  @Override
  protected void initData() {
    AlphaAnimation anim = new AlphaAnimation(0.5f, 1.0f);
    anim.setDuration(500);
    anim.setAnimationListener(new Animation.AnimationListener() {

      @Override
      public void onAnimationStart(Animation animation) {

      }

      @Override
      public void onAnimationRepeat(Animation animation) {

      }

      @Override
      public void onAnimationEnd(Animation animation) {
        startActivity(new Intent(SplashActivity.this, HomeActivity.class));
        finish();
      }
    });
    bgStart.startAnimation(anim);
    LogUtils.e("111");
    LogUtils.v("111");
  }
}